'use client'

import { useEffect } from 'react'
import { useRouter } from 'next/navigation'

export default function LoginPage() {
  const router = useRouter()

  useEffect(() => {
    // 自动重定向到Casdoor登录页面
    window.location.href = '/api/auth/login'
  }, [])

  return (
    <div className="min-h-screen bg-gray-100 flex items-center justify-center">
      <div className="max-w-md w-full space-y-8">
        <div>
          <h2 className="mt-6 text-center text-3xl font-extrabold text-gray-900">
            正在跳转到登录页面...
          </h2>
          <p className="mt-2 text-center text-sm text-gray-600">
            如果页面没有自动跳转，请点击下面的按钮
          </p>
        </div>
        <div className="mt-8 space-y-6">
          <a
            href="/api/auth/login"
            className="group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500"
          >
            前往登录
          </a>
          <div className="text-center">
            <a
              href="/"
              className="font-medium text-indigo-600 hover:text-indigo-500"
            >
              返回首页
            </a>
          </div>
        </div>
      </div>
    </div>
  )
} 